//
//  SleepTemperatureRightAlixFormmater.swift
//  DaRings
//
//  Created by 尹琼 on 2023/2/10.
//

import UIKit
import Charts

open class SleepTemperatureRightAxisValueFormatter: NSObject, IAxisValueFormatter {
    
    open func stringForValue(_ value: Double, axis: AxisBase?) -> String {
        
//        return "\(value)"
      
        let value = Double(Int(value * 10000))/10000.0
        
        if value > -0.09 && value < 0.09 {
            return "±0"
        }
        if value >= 0.1 {
            return "+\(String(format: "%.1f", value))"
        }
        
        return "\(String(format: "%.1f", value))"
        
    }
    
}
